<?php
    class log
    {
        //добавление лога
        public static function add($name, $text)
        {
            if ( setting::$info['check_log'] == 'true')
            {
                if (!empty($name))
                {
                    $s = $name.';'.time().';'.$text;
                    m::data_add('log.dat', $s);
                }
            }

        }

        public static function get( $param = array() )
        {
            $str =  m::data_read('log.dat', 10000);
            
            $array = explode("\r\n", $str);
            
            unset( $array[0] );
            unset( $array[count($array)] );
            
            if ( is_array($array) and count($array) > 0)
            { 
                $ar = array();
                
                foreach ($array as $num => $val)
                {
                   $m = explode(";", $val);
                   $ar [] =  $m;
                }
                
                krsort($ar);

                return $ar;
            }
            else
            {
                return false;
            }
            
        }        

    }
?>